package com.mht.student.entity;

@SuppressWarnings("all")
public class Student {
    private String id;
    private String name;
    private String className;
    private int englishScore;
    private int mathScore;
    private int javaScore;

    // 构造函数
    public Student(String id, String name, String className, int javaScore, int mathScore, int englishScore) {
        this.id = id;
        this.name = name;
        this.className = className;
        this.javaScore = javaScore;
        this.mathScore = mathScore;
        this.englishScore = englishScore;
    }

    // getter和setter方法
    public String getId() { return id; }
    public String getName() { return name; }
    public String getClassName() { return className; }
    public int getJavaScore() { return javaScore; }
    public int getMathScore() { return mathScore; }
    public int getEnglishScore() { return englishScore; }
    public int getTotalScore() { return javaScore + mathScore + englishScore; }
    public double getAverageScore() { return getTotalScore() / 3.0; }

    // toString方法
    @Override
    public String toString() {
        return id + "," + name + "," + className + ","  + javaScore + ","+ mathScore + "," + englishScore;
    }
    public String toPrint() {
        return "学号："+id + "," +"\t姓名："+ name + "," +"\t班级："+ className + ","
                +"\tJava分数："+ javaScore + "," +"\t数学分数："+ mathScore + "," +"\t英语分数："+ englishScore;
    }
}
